home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / programs / starttoaster < prev    next >
Text File  |  1995-12-22  |  3KB  |  130 lines

  1. /* StartToaster V2.1 -- Have the flyer start up however you like.      */
  2. /* By Bob Caron (Grue) © 1995 NewTek Inc.                              */
  3.  
  4. OPTIONS RESULTS
  5. TOASTERLIB="ToasterARexx.port"
  6.  
  7. call remlib('rexxsupport.library')
  8. call addlib("rexxsupport.library", 0,-30,0)
  9. call remlib('ToasterARexx.port')
  10. call remlib('PROJECT_REXX_PORT')
  11.  
  12. if ~exists("toaster:") then do
  13.   say "Start Toaster V2.1"
  14.   say
  15.   say "Your Toaster: assignment is missing, or has been removed."
  16.   say
  17.   say "Some possible solutions:"
  18.   say
  19.   say "1) Reboot your computer and try again."
  20.   say "2) Re-Install your Toaster/Flyer software."
  21.   say "   (A minimal install is sufficient.)"
  22.   say
  23.   say "Press <Return> to continue."
  24.   pull stuff
  25.   call quit
  26.   end
  27.  
  28. if ~exists("toaster:programs/videotoaster") then do
  29.   say "Start Toaster V2.1"
  30.   say
  31.   say "I can't find the program 'VideoToaster' (needed for this software to run)."
  32.   say
  33.   say "Some possible reasons for this failure:"
  34.   say
  35.   say "1) Your toaster: assign may be pointing to the wrong location."
  36.   say "2) You are running ScreamerNet. StartToaster MUST be run before you"
  37.   say "   run a ScreamerNet node."
  38.   say "3) Your Toaster software is missing important system files."
  39.   say "   Run CheckSoftware to verify."
  40.   say
  41.   say "Press <Return> to continue."
  42.   pull stuff
  43.   call quit
  44.   end
  45.  
  46. startdir="toaster:arexx/editor/StartUpScripts"
  47.  
  48. if exists(startdir) then startup=1
  49. else startup=0
  50.  
  51. dir=showdir(startdir,'f','*')
  52. temp=translate(dir,'?',' ','?')
  53. temp2=translate(temp,' ','*',' ')
  54. dir = temp2
  55.  
  56. IF SHOW('Ports','PROJECT_REXX_PORT') THEN
  57.   IF ADDLIB('ToasterARexx.port' , 0) THEN x=Bummer("The Video Toaster/Flyer software is already running!! ")
  58.  
  59. call pragma("D","toaster:programs")
  60.  
  61. address command "run >NIL: toaster:programs/videotoaster"
  62.  
  63. do while ~SHOW('Ports','PROJECT_REXX_PORT')
  64.    address command "c:wait 1"
  65. end
  66.  
  67. call addlib('PROJECT_REXX_PORT' , 0)
  68. call addlib('ToasterARexx.port' , 0)
  69.  
  70. /* Add Startup Code here... */
  71.  
  72. call set_view(4)
  73.  
  74. if startup=1 then do
  75.    loopto=words(dir); loop=1
  76.    do while (loop<loopto+1)
  77.       program=translate(word(dir,loop),' ','?')
  78.       filenam=program
  79.       if upper(right(program,5))=".REXX" then
  80.          filenam=left(program,length(filenam)-5)
  81.       if isarexx(startdir||"/"||program) then
  82.          number=LADDTOOL(filenam,startdir||"/"||program||" 1",1)
  83.       if number=12 then break
  84.       loop=loop+1
  85.    end
  86. end
  87.  
  88. /* End of code. */
  89.  
  90. quit:
  91.  
  92. call remlib('ToasterARexx.port')
  93. call remlib('PROJECT_REXX_PORT')
  94. call remlib('rexxsupport.library')
  95. exit
  96.  
  97. bummer: /* <- An Arnie like error system */
  98. parse arg message
  99. say "Start Toaster V2.1"
  100. say
  101. say message
  102. address command "c:wait 3"
  103. exit
  104.  
  105. isarexx:
  106. parse arg file
  107. if exists(file) then do
  108.     if open('infile',file,'READ') then do
  109.        filestart = readch('infile',2)
  110.        call close('infile')
  111.        if filestart="/*" then return 1
  112.     end
  113. end
  114. return 0
  115.  
  116. laddtool: procedure
  117. parse arg filenam,start,number
  118.  
  119. signal on error
  120. signal on syntax
  121.  
  122. call ADDTOOL(filenam,start,number)
  123.  
  124. syntax:
  125. error:
  126.  
  127. signal off error
  128.  
  129. return rc
  130.